# -*- coding: utf-8 -*- #

# ------------------------------------------------------------------
# File Name:        new_pool.py
# Author:           630
# Updated:          2024/01/07
# ------------------------------------------------------------------
from .pool import Pool


# 这是一个新建pool家族对象的范例
class New_Pool(Pool):
    def __init__(self):
        self.pool = {}

    def set_object(self, object, name: str):
        super(New_Pool, self).set_object(object, name)
        self.pool[name] = object

    def capacity(self):
        super(New_Pool, self).capacity()
        length = self.pool.__len__()
        return length

    def find(self, name):
        super(New_Pool, self).find(name)
        return self.pool[name]
